#ifndef CHATUSERWID_H
#define CHATUSERWID_H

#include <QWidget>
#include<QSize>
#include"listitembase.h"
#include"global.h"
#include"userdata.h"
namespace Ui {
class ChatUserWid;
}

class ChatUserWid : public ListItemBase
{
    Q_OBJECT

public:
    explicit ChatUserWid(QWidget *parent = nullptr);
    ~ChatUserWid();

    QSize sizeHint()const override{
        return QSize(275,90);
    }

    // void setInfo(QString name,QString head,QString msg);
    void setInfo(std::shared_ptr<UserInfo>user_info);
    void setInfo(std::shared_ptr<FriendInfo> friend_info);
    std::shared_ptr<UserInfo> GetUserInfo();
    void updateLastMsg(std::vector<std::shared_ptr<TextChatData>> msgs);
private:
    Ui::ChatUserWid *ui;

    std::shared_ptr<UserInfo>_user_info;
};

#endif // CHATUSERWID_H
